package com.dfiov.cloud.msmtools.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author ：TC-ZhangYi
 * @date ：2023-7-18 17:05
 * @className ：VehicleStatusEnum
 * @description：车辆风控（当前）状态
 */
@AllArgsConstructor
@Getter
public enum VehicleStatusEnum {

    NORMAL(0,"正常"),
    LOCK(1,"锁车"),
    LIMP(2,"跛行"),
    EXPECT(3,"待反馈"),
    ;

    public static String getTypeByDesc(Integer type) {
        if (Objects.isNull(type)) {
            return null;
        }
        for (VehicleStatusEnum statusEnum : values()) {
            if (Objects.equals(statusEnum.type, type)) {
                return statusEnum.desc;
            }
        }
        return null;
    }

    private final Integer type;
    private final String desc;
}
